package com.guangyunl.d_var;
//需求一:
//        返回n个字符串拼接结果，如果没有传入字符串，那么返回空字符串""
public class Demo02Var {
    public static void main(String[] args) {
        String result = concat("张三", "李四", "王五" , "赵六");
        System.out.println("result = " + result);
        System.out.println("===========================");
        System.out.println("不传入字符串=" + concat());
    }

    public static String concat(String...strings){
        String str = "";
        for (int i = 0; i < strings.length; i++) {
            str+=strings[i];
        }
        return str;
    }
}
/*
result = 张三李四王五赵六
===========================
不传入字符串=
 */